package umich.max.geolocation.featextract.icf;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.HashMap;
import java.util.List;

import max.nlp.wrappers.ml.weka.FeatureSaver;

public class ICFLoader {

	

	public static HashMap<String, Double>  load(String file) {
		try {
			// Read from disk using FileInputStream
			FileInputStream f_in = new FileInputStream(file);

			// Read object using ObjectInputStream
			ObjectInputStream obj_in = new ObjectInputStream(f_in);

			// Read an object
			Object obj = obj_in.readObject();

			// Should probably do some type checking at some point
			return (HashMap<String, Double>) obj;
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		return null;
	}



	public static void main(String[] args) {
		ICFLoader f = new ICFLoader();
		load("/home/max/workspace/geolocation/icfs");
	}
}
